Dynomotion

Group: DynoMotion Message: 1148 From: rhayuk Date: 5/18/2011
Subject: Mach 3 KFlop spindle control
I wonder if anyone can help, I have motion control through Mach3, however I am unable to get spindle control. I have a VFD taking in 0-10v, my preferred option was to use PWM0 and then just adjust the gain on the VFD to gain full control, my second option is to use a Step/dirn to voltage card which I have but has in the past been a bit variable. I can get the step/dirn to DC card to work when using the step response screen in kmotion. I believe my problem lies in the c code, the sample PWM c code does not have the full outputs to drive. Any pointers appreciated.
Richard
Group: DynoMotion Message: 1149 From: albertplatek Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Hi Richard
you need convert pwm signal to analog linear signal 0-10V for VFD
Here is a simple example of schamatic:
http://www.cjh.com.au/PWMConverter.pdf

Regards
Albert

--- In DynoMotion@yahoogroups.com, "rhayuk" <rhay@...> wrote:
>
> I wonder if anyone can help, I have motion control through Mach3, however I am unable to get spindle control. I have a VFD taking in 0-10v, my preferred option was to use PWM0 and then just adjust the gain on the VFD to gain full control, my second option is to use a Step/dirn to voltage card which I have but has in the past been a bit variable. I can get the step/dirn to DC card to work when using the step response screen in kmotion. I believe my problem lies in the c code, the sample PWM c code does not have the full outputs to drive. Any pointers appreciated.
> Richard
>
Group: DynoMotion Message: 1150 From: rhayuk Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Albert,
Thanks for reply, you wouldnt happen to have a c code file to drive the spindle using mach 3?

--- In DynoMotion@yahoogroups.com, "albertplatek" <albertplatek86@...> wrote:
>
> Hi Richard
> you need convert pwm signal to analog linear signal 0-10V for VFD
> Here is a simple example of schamatic:
> http://www.cjh.com.au/PWMConverter.pdf
>
> Regards
> Albert
>
> --- In DynoMotion@yahoogroups.com, "rhayuk" <rhay@> wrote:
> >
> > I wonder if anyone can help, I have motion control through Mach3, however I am unable to get spindle control. I have a VFD taking in 0-10v, my preferred option was to use PWM0 and then just adjust the gain on the VFD to gain full control, my second option is to use a Step/dirn to voltage card which I have but has in the past been a bit variable. I can get the step/dirn to DC card to work when using the step response screen in kmotion. I believe my problem lies in the c code, the sample PWM c code does not have the full outputs to drive. Any pointers appreciated.
> > Richard
> >
>
Group: DynoMotion Message: 1151 From: albertplatek Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Hi again
Sorry but I am not using mach 3, but only kmotioncnc, but I am sure that someone will help you soon.

Regards
Albert

--- In DynoMotion@yahoogroups.com, "rhayuk" <rhay@...> wrote:
>
> Albert,
> Thanks for reply, you wouldnt happen to have a c code file to drive the spindle using mach 3?
>
> --- In DynoMotion@yahoogroups.com, "albertplatek" <albertplatek86@> wrote:
> >
> > Hi Richard
> > you need convert pwm signal to analog linear signal 0-10V for VFD
> > Here is a simple example of schamatic:
> > http://www.cjh.com.au/PWMConverter.pdf
> >
> > Regards
> > Albert
> >
> > --- In DynoMotion@yahoogroups.com, "rhayuk" <rhay@> wrote:
> > >
> > > I wonder if anyone can help, I have motion control through Mach3, however I am unable to get spindle control. I have a VFD taking in 0-10v, my preferred option was to use PWM0 and then just adjust the gain on the VFD to gain full control, my second option is to use a Step/dirn to voltage card which I have but has in the past been a bit variable. I can get the step/dirn to DC card to work when using the step response screen in kmotion. I believe my problem lies in the c code, the sample PWM c code does not have the full outputs to drive. Any pointers appreciated.
> > > Richard
> > >
> >
>
Group: DynoMotion Message: 1152 From: Tom Kerekes Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Hi Richard,
 
There is a c example called PWM1KHz.c that should generate a 50% duty cycle 1KHz PWM signal.  Use that to test your hardware.  Change the value of 128 from 0 to 255 to change the duty cycle.  Change the prescale value of 65 to change the frequency if you need other than 1KHz.
 
Here is the SpindleMach3DAC.c example with the code for controlling the DAC replaced with code to control the PWM:
 
 
Mach3 has a concept of "Pulley Speeds".  So for example if you setup a Pulley with a max speed of 4000 RPM and your GCode commands S1000 then the plugin will be sent a "speed" of 0.25 which is the fraction of max speed.
 
Please let us know if it works out for you.
 
Regards
TK 

 

Group: DynoMotion Message: 1153 From: rhayuk Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Tom,
PWM control works a treat, I am achieving a working spindle speed from 500-5000 Rpm and with filtering on the VFD proving stable, less than 5% fluctuation on spindle speed..... however there is a small catch... If I turn the spindle off in Mach3, Reset or Estop the spindle is still happily turning. Is there variables to be included/pass through?
Group: DynoMotion Message: 1154 From: Tom Kerekes Date: 5/18/2011
Subject: Re: Mach 3 KFlop spindle control
Hi Richard,
 
As written that C program assumes that besides the PWM output there are two outputs Forward and Reverse in your system.  So the EX_SPINOFF case just turns both of those off assuming that having those off will stop the spindle.  If you don't have those, I added code to turn off the PWM output as well.  If you re-download the program you should see the change.
 
Regards
TK  

Group: DynoMotion Message: 1156 From: rhayuk Date: 5/19/2011
Subject: Re: Mach 3 KFlop spindle control
Tom,
Worked a treat, many thanks! Card is excellent! Has anyone else had problems with jogging using the xbox plug in within Mach 3? Hit a direction and away it goes... with no stopping!


--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi Richard,
>
> As written that C program assumes that besides the PWM output there are two
> outputs Forward and Reverse in your system.  So the EX_SPINOFF case just turns
> both of those off assuming that having those off will stop the spindle.  If you
> don't have those, I added code to turn off the PWM output as well.  If you
> re-download the program you should see the change.
>
> Regards
> TK  
>
>
>
>
> ________________________________
> From: rhayuk <rhay@...>
> To: DynoMotion@yahoogroups.com
> Sent: Wed, May 18, 2011 1:06:21 PM
> Subject: [DynoMotion] Re: Mach 3 KFlop spindle control
>
>  
>
>
> Tom,
> PWM control works a treat, I am achieving a working spindle speed from 500-5000
> Rpm and with filtering on the VFD proving stable, less than 5% fluctuation on
> spindle speed..... however there is a small catch... If I turn the spindle off
> in Mach3, Reset or Estop the spindle is still happily turning. Is there
> variables to be included/pass through?
>